<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
      <el-form-item label="单位" prop="department">
        <el-input
          v-model="queryParams.department"
          placeholder="请输入单位"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="姓名" prop="username">
        <el-input
          v-model="queryParams.username"
          placeholder="请输入姓名"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="身份证号" prop="idNumber">
        <el-input
          v-model="queryParams.idNumber"
          placeholder="请输入身份证号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="部门" prop="deptid">
        <el-input
          v-model="queryParams.deptid"
          placeholder="请输入部门"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="事由" prop="causes">
        <el-input
          v-model="queryParams.causes"
          placeholder="请输入事由"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="开始时间" prop="leaveStartTime">
        <el-date-picker clearable
          v-model="queryParams.leaveStartTime"
          type="date"
          value-format="yyyy-MM-dd"
          placeholder="请选择开始时间">
        </el-date-picker>
      </el-form-item>
      <el-form-item label="结束时间" prop="leaveEndTime">
        <el-date-picker clearable
          v-model="queryParams.leaveEndTime"
          type="date"
          value-format="yyyy-MM-dd"
          placeholder="请选择结束时间">
        </el-date-picker>
      </el-form-item>
      <el-form-item label="销假情况" prop="leaveSituation">
        <el-input
          v-model="queryParams.leaveSituation"
          placeholder="请输入销假情况"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="休假地点" prop="leaveAddress">
        <el-input
          v-model="queryParams.leaveAddress"
          placeholder="请输入休假地点"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="用户ID" prop="userId">
        <el-input
          v-model="queryParams.userId"
          placeholder="请输入用户ID"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="部门ID" prop="deptId">
        <el-input
          v-model="queryParams.deptId"
          placeholder="请输入部门ID"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="部门负责人姓名" prop="departmentHeadName">
        <el-input
          v-model="queryParams.departmentHeadName"
          placeholder="请输入部门负责人姓名"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="部门负责人身份证号" prop="departmentHeadIdnum">
        <el-input
          v-model="queryParams.departmentHeadIdnum"
          placeholder="请输入部门负责人身份证号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="部门负责人审批结果" prop="departmentHeadResult">
        <el-input
          v-model="queryParams.departmentHeadResult"
          placeholder="请输入部门负责人审批结果"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="部门负责人审批时间" prop="departmentHeadTime">
        <el-date-picker clearable
          v-model="queryParams.departmentHeadTime"
          type="date"
          value-format="yyyy-MM-dd"
          placeholder="请选择部门负责人审批时间">
        </el-date-picker>
      </el-form-item>
      <el-form-item label="部门负责人审批意见" prop="departmentHeadSuggest">
        <el-input
          v-model="queryParams.departmentHeadSuggest"
          placeholder="请输入部门负责人审批意见"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="部门负责人是否代审" prop="departmentHeadIsacting">
        <el-input
          v-model="queryParams.departmentHeadIsacting"
          placeholder="请输入部门负责人是否代审"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="部门负责人代审字符" prop="departmentHeadCharacter">
        <el-input
          v-model="queryParams.departmentHeadCharacter"
          placeholder="请输入部门负责人代审字符"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="局长姓名" prop="directorGeneralName">
        <el-input
          v-model="queryParams.directorGeneralName"
          placeholder="请输入局长姓名"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="局长身份证号" prop="directorGeneralIdnum">
        <el-input
          v-model="queryParams.directorGeneralIdnum"
          placeholder="请输入局长身份证号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="局长审批结果" prop="directorGeneralResult">
        <el-input
          v-model="queryParams.directorGeneralResult"
          placeholder="请输入局长审批结果"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="局长审批时间" prop="directorGeneralTime">
        <el-date-picker clearable
          v-model="queryParams.directorGeneralTime"
          type="date"
          value-format="yyyy-MM-dd"
          placeholder="请选择局长审批时间">
        </el-date-picker>
      </el-form-item>
      <el-form-item label="局长审批意见" prop="directorGeneralSuggest">
        <el-input
          v-model="queryParams.directorGeneralSuggest"
          placeholder="请输入局长审批意见"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="局长是否代审" prop="directorGeneralIsacting">
        <el-input
          v-model="queryParams.directorGeneralIsacting"
          placeholder="请输入局长是否代审"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="局长代审字符" prop="directorGeneralCharacter">
        <el-input
          v-model="queryParams.directorGeneralCharacter"
          placeholder="请输入局长代审字符"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="政委姓名" prop="politicalCommissarName">
        <el-input
          v-model="queryParams.politicalCommissarName"
          placeholder="请输入政委姓名"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="政委身份证号" prop="politicalCommissarIdnum">
        <el-input
          v-model="queryParams.politicalCommissarIdnum"
          placeholder="请输入政委身份证号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="政委审批结果" prop="politicalCommissarResult">
        <el-input
          v-model="queryParams.politicalCommissarResult"
          placeholder="请输入政委审批结果"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="政委审批时间" prop="politicalCommissarTime">
        <el-date-picker clearable
          v-model="queryParams.politicalCommissarTime"
          type="date"
          value-format="yyyy-MM-dd"
          placeholder="请选择政委审批时间">
        </el-date-picker>
      </el-form-item>
      <el-form-item label="政委审批意见" prop="politicalCommissarSuggest">
        <el-input
          v-model="queryParams.politicalCommissarSuggest"
          placeholder="请输入政委审批意见"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="政委是否代审" prop="politicalCommissarIsacting">
        <el-input
          v-model="queryParams.politicalCommissarIsacting"
          placeholder="请输入政委是否代审"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="政委代审字符" prop="politicalCommissarCharacter">
        <el-input
          v-model="queryParams.politicalCommissarCharacter"
          placeholder="请输入政委代审字符"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="休假审核总状态" prop="leaveTotalState">
        <el-input
          v-model="queryParams.leaveTotalState"
          placeholder="请输入休假审核总状态"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="创建者" prop="createBy">
        <el-input
          v-model="queryParams.createBy"
          placeholder="请输入创建者"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="创建时间" prop="createTime">
        <el-date-picker clearable
          v-model="queryParams.createTime"
          type="date"
          value-format="yyyy-MM-dd"
          placeholder="请选择创建时间">
        </el-date-picker>
      </el-form-item>
      <el-form-item label="更新者" prop="updateBy">
        <el-input
          v-model="queryParams.updateBy"
          placeholder="请输入更新者"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="更新时间" prop="updateTime">
        <el-date-picker clearable
          v-model="queryParams.updateTime"
          type="date"
          value-format="yyyy-MM-dd"
          placeholder="请选择更新时间">
        </el-date-picker>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
      </el-form-item>
    </el-form>

    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
          type="primary"
          plain
          icon="el-icon-plus"
          size="mini"
          @click="handleAdd"
          v-hasPermi="['system:vacation:add']"
        >新增</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="success"
          plain
          icon="el-icon-edit"
          size="mini"
          :disabled="single"
          @click="handleUpdate"
          v-hasPermi="['system:vacation:edit']"
        >修改</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="danger"
          plain
          icon="el-icon-delete"
          size="mini"
          :disabled="multiple"
          @click="handleDelete"
          v-hasPermi="['system:vacation:remove']"
        >删除</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="warning"
          plain
          icon="el-icon-download"
          size="mini"
          @click="handleExport"
          v-hasPermi="['system:vacation:export']"
        >导出</el-button>
      </el-col>
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
    </el-row>

    <el-table v-loading="loading" :data="vacationList" @selection-change="handleSelectionChange">
      <el-table-column type="selection" width="55" align="center" />
      <el-table-column label="ID" align="center" prop="id" />
      <el-table-column label="单位" align="center" prop="department" />
      <el-table-column label="姓名" align="center" prop="username" />
      <el-table-column label="身份证号" align="center" prop="idNumber" />
      <el-table-column label="部门" align="center" prop="deptid" />
      <el-table-column label="事由" align="center" prop="causes" />
      <el-table-column label="开始时间" align="center" prop="leaveStartTime" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.leaveStartTime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="结束时间" align="center" prop="leaveEndTime" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.leaveEndTime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="销假情况" align="center" prop="leaveSituation" />
      <el-table-column label="休假地点" align="center" prop="leaveAddress" />
      <el-table-column label="用户ID" align="center" prop="userId" />
      <el-table-column label="部门ID" align="center" prop="deptId" />
      <el-table-column label="部门负责人姓名" align="center" prop="departmentHeadName" />
      <el-table-column label="部门负责人身份证号" align="center" prop="departmentHeadIdnum" />
      <el-table-column label="部门负责人审批结果" align="center" prop="departmentHeadResult" />
      <el-table-column label="部门负责人审批时间" align="center" prop="departmentHeadTime" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.departmentHeadTime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="部门负责人审批意见" align="center" prop="departmentHeadSuggest" />
      <el-table-column label="部门负责人是否代审" align="center" prop="departmentHeadIsacting" />
      <el-table-column label="部门负责人代审字符" align="center" prop="departmentHeadCharacter" />
      <el-table-column label="局长姓名" align="center" prop="directorGeneralName" />
      <el-table-column label="局长身份证号" align="center" prop="directorGeneralIdnum" />
      <el-table-column label="局长审批结果" align="center" prop="directorGeneralResult" />
      <el-table-column label="局长审批时间" align="center" prop="directorGeneralTime" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.directorGeneralTime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="局长审批意见" align="center" prop="directorGeneralSuggest" />
      <el-table-column label="局长是否代审" align="center" prop="directorGeneralIsacting" />
      <el-table-column label="局长代审字符" align="center" prop="directorGeneralCharacter" />
      <el-table-column label="政委姓名" align="center" prop="politicalCommissarName" />
      <el-table-column label="政委身份证号" align="center" prop="politicalCommissarIdnum" />
      <el-table-column label="政委审批结果" align="center" prop="politicalCommissarResult" />
      <el-table-column label="政委审批时间" align="center" prop="politicalCommissarTime" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.politicalCommissarTime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="政委审批意见" align="center" prop="politicalCommissarSuggest" />
      <el-table-column label="政委是否代审" align="center" prop="politicalCommissarIsacting" />
      <el-table-column label="政委代审字符" align="center" prop="politicalCommissarCharacter" />
      <el-table-column label="休假审核总状态" align="center" prop="leaveTotalState" />
      <el-table-column label="创建者" align="center" prop="createBy" />
      <el-table-column label="创建时间" align="center" prop="createTime" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="更新者" align="center" prop="updateBy" />
      <el-table-column label="更新时间" align="center" prop="updateTime" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.updateTime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="备注" align="center" prop="remark" />
      <el-table-column label="备注1" align="center" prop="note1" />
      <el-table-column label="备注2" align="center" prop="note2" />
      <el-table-column label="备注3" align="center" prop="note3" />
      <el-table-column label="备注4" align="center" prop="note4" />
      <el-table-column label="备注5" align="center" prop="note5" />
      <el-table-column label="备注6" align="center" prop="note6" />
      <el-table-column label="备注7" align="center" prop="note7" />
      <el-table-column label="备注8" align="center" prop="note8" />
      <el-table-column label="备注9" align="center" prop="note9" />
      <el-table-column label="备注10" align="center" prop="note10" />
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
        <template slot-scope="scope">
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleUpdate(scope.row)"
            v-hasPermi="['system:vacation:edit']"
          >修改</el-button>
          <el-button
            size="mini"
            type="text"
            icon="el-icon-delete"
            @click="handleDelete(scope.row)"
            v-hasPermi="['system:vacation:remove']"
          >删除</el-button>
        </template>
      </el-table-column>
    </el-table>
    
    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />

    <!-- 添加或修改休假记录对话框 -->
    <el-dialog :title="title" :visible.sync="open" width="1000px" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
        <el-form-item label="单位" prop="department">
          <el-input v-model="form.department" placeholder="请输入单位" />
        </el-form-item>
        <el-form-item label="姓名" prop="username">
          <el-input v-model="form.username" placeholder="请输入姓名" />
        </el-form-item>
        <el-form-item label="身份证号" prop="idNumber">
          <el-input v-model="form.idNumber" placeholder="请输入身份证号" />
        </el-form-item>
        <el-form-item label="部门" prop="deptid">
          <el-input v-model="form.deptid" placeholder="请输入部门" />
        </el-form-item>
        <el-form-item label="事由" prop="causes">
          <el-input v-model="form.causes" placeholder="请输入事由" />
        </el-form-item>
        <el-form-item label="开始时间" prop="leaveStartTime">
          <el-date-picker clearable
            v-model="form.leaveStartTime"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="请选择开始时间">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="结束时间" prop="leaveEndTime">
          <el-date-picker clearable
            v-model="form.leaveEndTime"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="请选择结束时间">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="销假情况" prop="leaveSituation">
          <el-input v-model="form.leaveSituation" placeholder="请输入销假情况" />
        </el-form-item>
        <el-form-item label="休假地点" prop="leaveAddress">
          <el-input v-model="form.leaveAddress" placeholder="请输入休假地点" />
        </el-form-item>
        <el-form-item label="用户ID" prop="userId">
          <el-input v-model="form.userId" placeholder="请输入用户ID" />
        </el-form-item>
        <el-form-item label="部门ID" prop="deptId">
          <el-input v-model="form.deptId" placeholder="请输入部门ID" />
        </el-form-item>
        <el-form-item label="部门负责人姓名" prop="departmentHeadName">
          <el-input v-model="form.departmentHeadName" placeholder="请输入部门负责人姓名" />
        </el-form-item>
        <el-form-item label="部门负责人身份证号" prop="departmentHeadIdnum">
          <el-input v-model="form.departmentHeadIdnum" placeholder="请输入部门负责人身份证号" />
        </el-form-item>
        <el-form-item label="部门负责人审批结果" prop="departmentHeadResult">
          <el-input v-model="form.departmentHeadResult" placeholder="请输入部门负责人审批结果" />
        </el-form-item>
        <el-form-item label="部门负责人审批时间" prop="departmentHeadTime">
          <el-date-picker clearable
            v-model="form.departmentHeadTime"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="请选择部门负责人审批时间">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="部门负责人审批意见" prop="departmentHeadSuggest">
          <el-input v-model="form.departmentHeadSuggest" placeholder="请输入部门负责人审批意见" />
        </el-form-item>
        <el-form-item label="部门负责人是否代审" prop="departmentHeadIsacting">
          <el-input v-model="form.departmentHeadIsacting" placeholder="请输入部门负责人是否代审" />
        </el-form-item>
        <el-form-item label="部门负责人代审字符" prop="departmentHeadCharacter">
          <el-input v-model="form.departmentHeadCharacter" placeholder="请输入部门负责人代审字符" />
        </el-form-item>
        <el-form-item label="局长姓名" prop="directorGeneralName">
          <el-input v-model="form.directorGeneralName" placeholder="请输入局长姓名" />
        </el-form-item>
        <el-form-item label="局长身份证号" prop="directorGeneralIdnum">
          <el-input v-model="form.directorGeneralIdnum" placeholder="请输入局长身份证号" />
        </el-form-item>
        <el-form-item label="局长审批结果" prop="directorGeneralResult">
          <el-input v-model="form.directorGeneralResult" placeholder="请输入局长审批结果" />
        </el-form-item>
        <el-form-item label="局长审批时间" prop="directorGeneralTime">
          <el-date-picker clearable
            v-model="form.directorGeneralTime"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="请选择局长审批时间">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="局长审批意见" prop="directorGeneralSuggest">
          <el-input v-model="form.directorGeneralSuggest" placeholder="请输入局长审批意见" />
        </el-form-item>
        <el-form-item label="局长是否代审" prop="directorGeneralIsacting">
          <el-input v-model="form.directorGeneralIsacting" placeholder="请输入局长是否代审" />
        </el-form-item>
        <el-form-item label="局长代审字符" prop="directorGeneralCharacter">
          <el-input v-model="form.directorGeneralCharacter" placeholder="请输入局长代审字符" />
        </el-form-item>
        <el-form-item label="政委姓名" prop="politicalCommissarName">
          <el-input v-model="form.politicalCommissarName" placeholder="请输入政委姓名" />
        </el-form-item>
        <el-form-item label="政委身份证号" prop="politicalCommissarIdnum">
          <el-input v-model="form.politicalCommissarIdnum" placeholder="请输入政委身份证号" />
        </el-form-item>
        <el-form-item label="政委审批结果" prop="politicalCommissarResult">
          <el-input v-model="form.politicalCommissarResult" placeholder="请输入政委审批结果" />
        </el-form-item>
        <el-form-item label="政委审批时间" prop="politicalCommissarTime">
          <el-date-picker clearable
            v-model="form.politicalCommissarTime"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="请选择政委审批时间">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="政委审批意见" prop="politicalCommissarSuggest">
          <el-input v-model="form.politicalCommissarSuggest" placeholder="请输入政委审批意见" />
        </el-form-item>
        <el-form-item label="政委是否代审" prop="politicalCommissarIsacting">
          <el-input v-model="form.politicalCommissarIsacting" placeholder="请输入政委是否代审" />
        </el-form-item>
        <el-form-item label="政委代审字符" prop="politicalCommissarCharacter">
          <el-input v-model="form.politicalCommissarCharacter" placeholder="请输入政委代审字符" />
        </el-form-item>
        <el-form-item label="休假审核总状态" prop="leaveTotalState">
          <el-input v-model="form.leaveTotalState" placeholder="请输入休假审核总状态" />
        </el-form-item>
        <el-form-item label="备注" prop="remark">
          <el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="备注1" prop="note1">
          <el-input v-model="form.note1" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="备注2" prop="note2">
          <el-input v-model="form.note2" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="备注3" prop="note3">
          <el-input v-model="form.note3" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="备注4" prop="note4">
          <el-input v-model="form.note4" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="备注5" prop="note5">
          <el-input v-model="form.note5" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="备注6" prop="note6">
          <el-input v-model="form.note6" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="备注7" prop="note7">
          <el-input v-model="form.note7" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="备注8" prop="note8">
          <el-input v-model="form.note8" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="备注9" prop="note9">
          <el-input v-model="form.note9" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="备注10" prop="note10">
          <el-input v-model="form.note10" type="textarea" placeholder="请输入内容" />
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import { listVacation, getVacation, delVacation, addVacation, updateVacation } from "@/api/system/vacation";

export default {
  name: "Vacation",
  data() {
    return {
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 休假记录表格数据
      vacationList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        department: null,
        username: null,
        idNumber: null,
        deptid: null,
        causes: null,
        leaveStartTime: null,
        leaveEndTime: null,
        leaveSituation: null,
        leaveAddress: null,
        userId: null,
        deptId: null,
        departmentHeadName: null,
        departmentHeadIdnum: null,
        departmentHeadResult: null,
        departmentHeadTime: null,
        departmentHeadSuggest: null,
        departmentHeadIsacting: null,
        departmentHeadCharacter: null,
        directorGeneralName: null,
        directorGeneralIdnum: null,
        directorGeneralResult: null,
        directorGeneralTime: null,
        directorGeneralSuggest: null,
        directorGeneralIsacting: null,
        directorGeneralCharacter: null,
        politicalCommissarName: null,
        politicalCommissarIdnum: null,
        politicalCommissarResult: null,
        politicalCommissarTime: null,
        politicalCommissarSuggest: null,
        politicalCommissarIsacting: null,
        politicalCommissarCharacter: null,
        leaveTotalState: null,
        createBy: null,
        createTime: null,
        updateBy: null,
        updateTime: null,
        remark: null,
        note1: null,
        note2: null,
        note3: null,
        note4: null,
        note5: null,
        note6: null,
        note7: null,
        note8: null,
        note9: null,
        note10: null
      },
      // 表单参数
      form: {},
      // 表单校验
      rules: {
      }
    };
  },
  created() {
    this.getList();
  },
  methods: {
    /** 查询休假记录列表 */
    getList() {
      this.loading = true;
      listVacation(this.queryParams).then(response => {
        this.vacationList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    // 表单重置
    reset() {
      this.form = {
        id: null,
        department: null,
        username: null,
        idNumber: null,
        deptid: null,
        causes: null,
        leaveStartTime: null,
        leaveEndTime: null,
        leaveSituation: null,
        leaveAddress: null,
        userId: null,
        deptId: null,
        departmentHeadName: null,
        departmentHeadIdnum: null,
        departmentHeadResult: null,
        departmentHeadTime: null,
        departmentHeadSuggest: null,
        departmentHeadIsacting: null,
        departmentHeadCharacter: null,
        directorGeneralName: null,
        directorGeneralIdnum: null,
        directorGeneralResult: null,
        directorGeneralTime: null,
        directorGeneralSuggest: null,
        directorGeneralIsacting: null,
        directorGeneralCharacter: null,
        politicalCommissarName: null,
        politicalCommissarIdnum: null,
        politicalCommissarResult: null,
        politicalCommissarTime: null,
        politicalCommissarSuggest: null,
        politicalCommissarIsacting: null,
        politicalCommissarCharacter: null,
        leaveTotalState: null,
        createBy: null,
        createTime: null,
        updateBy: null,
        updateTime: null,
        remark: null,
        note1: null,
        note2: null,
        note3: null,
        note4: null,
        note5: null,
        note6: null,
        note7: null,
        note8: null,
        note9: null,
        note10: null
      };
      this.resetForm("form");
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm");
      this.handleQuery();
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.id)
      this.single = selection.length!==1
      this.multiple = !selection.length
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.reset();
      this.open = true;
      this.title = "添加休假记录";
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.reset();
      const id = row.id || this.ids
      getVacation(id).then(response => {
        this.form = response.data;
        this.open = true;
        this.title = "修改休假记录";
      });
    },
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          if (this.form.id != null) {
            updateVacation(this.form).then(response => {
              this.$modal.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            });
          } else {
            addVacation(this.form).then(response => {
              this.$modal.msgSuccess("新增成功");
              this.open = false;
              this.getList();
            });
          }
        }
      });
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      const ids = row.id || this.ids;
      this.$modal.confirm('是否确认删除休假记录编号为"' + ids + '"的数据项？').then(function() {
        return delVacation(ids);
      }).then(() => {
        this.getList();
        this.$modal.msgSuccess("删除成功");
      }).catch(() => {});
    },
    /** 导出按钮操作 */
    handleExport() {
      this.download('system/vacation/export', {
        ...this.queryParams
      }, `vacation_${new Date().getTime()}.xlsx`)
    }
  }
};
</script>
